<extend name="Public/base"/>

<block name="body">
	<!-- 标题栏 -->
	<div class="main-title">
		<h2>回收站({:count($list)})</h2>
	</div>

	<div class="cf">
	<div class="tools auth-botton">
		<button url="{:U('Item/permit')}" class="btn ajax-post" target-form="ids">还 原</button>
        <button url="{:U('Item/clear')}" class="btn ajax-post" target-form="ids">清 空</button>
        <a class="btn" href="{:U('recycle')}">刷 新</a>（点击"刷新"按钮清除搜索条件，显示全部信息。）
    </div>
    <div class="search-form fr cf">
        <input type="text" name="store" class="search-input w-260" value="{:I('store')}" placeholder="店铺名称">
        <a class="sch-btn" href="javascript:;" id="search" url="{:U()}"><i class="btn-search"></i></a>
    </div>

    </div>
	<!-- 数据表格 -->
	<div class="data-table">
		<table>
			<!-- 表头 -->
			<thead>
				<tr>
					<th class="row-selected row-selected"><input class="check-all" type="checkbox"></th>
					<th>商品编号</th>
					<th>商品名称</th>
					<th>分类</th>
					<th width="80">操作</th>
				</tr>
			</thead>

			<!-- 列表 -->
			<tbody>
				<volist name="list" id="vo">
					<tr>
						<td><input class="ids" type="checkbox" value="{$vo['id']}" name="ids[]"></td>
						<td><a href="{:U('/Item/detail?id='.$vo['id'])}" target="_blank">{$vo.number}</a></td>
						<td><a href="{:U('/Item/detail?id='.$vo['id'])}" target="_blank">{$vo.name}</a></td>
						<td>{$vo.category}</td>
						<td>
							<a href="{:U('permit?ids='.$vo['id'])}" class="ajax-get">[还原]</a>
							<a href="{:U('clear?ids='.$vo['id'])}" class="confirm ajax-get">[删除]</a>
						</td>
					</tr>
				</volist>
			</tbody>
		</table>
	</div>
	<!-- 分页 -->
	<div class="page">
		{$_page}
	</div>
</block>
<block name="script">
    <script type="text/javascript">
        $(function(){
            //搜索功能
            $("#search").click(function(){
                var url = $(this).attr('url');
                var query  = $('.search-form').find('input').serialize();
                if(url.indexOf('?')>0){
                    url += '&' + query;
                }else{
                    url += '?' + query;
                }
                window.location.href = url;
            });
            //回车自动提交
            $('.search-form').find('input').keyup(function(event){
                if(event.keyCode===13){
                    $("#search").click();
                }
            });
            //导航高亮
            highlight_subnav("{:U('recycle')}");
        });
    </script>
</block>
